use tower_sessions::{cookie::time::Duration, session::Error, Expiry, MemoryStore, SessionManagerLayer};


pub async fn init_session() -> Result<SessionManagerLayer<MemoryStore>, Error> {
    let session_store = MemoryStore::default();
    let session_layer = SessionManagerLayer::new(session_store)
    .with_secure(false)
    .with_expiry(Expiry::OnInactivity(Duration::days(3)));
    Ok(session_layer)
}